<?php //debug($ordenesTags);   ?>
<?php 
    echo $this->Html->script(array(
        'print'
    )); 
?>
<div class="grid12">
    <div class="widget">
    <div id="areaImprimir">
        <div class="whead"><h6></h6><div class="clear"></div></div>
        
            <h2>DETALLE DE CONTRATOS</h2>
    <p></p>    
    <h4>DETALLE</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>C&oacute;digo</b></td>
            <td><?php echo $cont['Contrato']['codigo'];?></td> 
            <td><b>Descripci&oacute;n</b></td>
            <td><?php echo $cont['Contrato']['descripcion'];?></td>
    </tr>
    
    <tr>
            <td><b>Proveedor</b></td>
            <td><?php echo $cont['Contrato']['proveedor'];?></td>
    </tr>



    </table>
    <?php endforeach; ?>
    <h4>MONTO ($us.)</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Field Work Order ($us.)</b></td>
            <td><?php //echo $cont['Contrato']['monto1'];
            $montoP = $cont['Contrato']['monto1'];
                    $modMontoPrin = $this->Number->format($montoP, array(
                        'places' => 2,
                        'before' => ' ',
                        'escape' => false,
                        'decimals' => '.',
                        'thousands' => ','
                            ));
                    echo $modMontoPrin;
            ?></td> 
            <td><b>Change Work Order($us.)</b></td>
            <td><?php //echo $cont['Contrato']['monto2'];
            $montoP = $cont['Contrato']['monto2'];
                    $modMontoPrin = $this->Number->format($montoP, array(
                        'places' => 2,
                        'before' => ' ',
                        'escape' => false,
                        'decimals' => '.',
                        'thousands' => ','
                            ));
                    echo $modMontoPrin;
            ?></td>
    </tr>
    
    <tr>
            <td><b>Monto de Contrato($us.)</b></td>
            <td><?php //echo $cont['Contrato']['monto3'];
            $montoP = $cont['Contrato']['monto3'];
                    $modMontoPrin = $this->Number->format($montoP, array(
                        'places' => 2,
                        'before' => ' ',
                        'escape' => false,
                        'decimals' => '.',
                        'thousands' => ','
                            ));
                    echo $modMontoPrin;
            ?></td> 

    </tr>



    </table>
    <?php endforeach; ?>
    
    <h4 id="btCo">CHANGE ORDER (+)</h4>
    <div id="muestraCo">
    </div>
    <script>
        $("#btCo").click(function() {
            console.log('hizo click');
            $('#muestraCo').load('../ajaxcambiocontrato/<?php echo $detalle['0']['Contrato']['codigo']; ?>'); 
            $('#muestraCo').toggle('slow');                               
        });
    </script>
    
    <h4>DETALLE DE IAP Y CONTRACTUAL DOCUMENT</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>IAP</b></td>
            <td>
                <?php 
                    $iap =  $cont['Contrato']['IAP'];
                    if($iap == 1)
                    {
                        echo "Si Existe";
                    }else{
                        echo "No Existe";
                    }
                ?>                
            </td> 
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['volumen'];?></td>
    </tr>
    
    <tr>
            <td><b>IAP UBICACION</b></td>
            <td><?php echo $cont['Contrato']['IAP_ubicacion'];?></td> 
            
    </tr>
    
    <tr>
    <td><b>CONTRACTUAL DOCUMENT (COPIA)</b></td>
            <td>
                <?php 
                    $e = $cont['Contrato']['existe'];                     
                    //$iap =  $cont['Contrato']['IAP'];
                    if($e == 1)
                    {
                        echo "Si Existe";
                    }else{
                        echo "No Existe";
                    }                
                ?>
                </td>
            
    </tr>
    
    <tr>

            <td><b>CANTIDAD DE FIRMAS</b></td>
            <td><?php echo $cont['Contrato']['cantidad_firmas'];?></td>
    </tr>
    

    <tr>
            <td><b>CD UBICACION</b></td>
            <td><?php echo $cont['Contrato']['DC_ubicacion'];?></td>
            <td><b>OBSERVACIONES</b></td>
            <td><?php echo $cont['Contrato']['observaciones'];?></ 
    </tr>

    </table>
    <?php endforeach; ?>
    
    <h4>DETALLES DE DOCUMENTOS GENERALES</h4>
    
    
    <h4>General Correspondance</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['gc_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['gc_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Bidders List o RFP</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['blr_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['blr_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Bid Documents</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['bd_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['bd_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Subcontract Document(s)</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['sd_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['sd_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Insurance and Lien Notices</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['iln_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['iln_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Progress Reports</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['pr_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['pr_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Invoice</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['i_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['i_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Schedule</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['sc_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['sc_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Meeting Minutes</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['mm_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['mm_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Project Control Weekly / Daily</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['pcw_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['pcw_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>QA / QC</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['qa_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['qa_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Safety</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['s_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['s_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Field Work Order & CCAF'S</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['fwo_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['fwo_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Change Work Order</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['cwo_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['cwo_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Contract Register</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['cr_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['cr_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Claims</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['c_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['c_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Contract Close - Out Process</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['cco_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['cco_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    <h4>Paymente Request</h4>
    <?php foreach ($detalle as $cont): ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tAlt">
    <tr>
            <td><b>Volumenes</b></td>
            <td><?php echo $cont['Contrato']['par_volumen'];?></td> 
            <td><b>Caja</b></td>
            <td><?php echo $cont['Contrato']['par_caja'];?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    
    
    </div>
    </div>
</div>

<div class="grid12">
    <div class="widget">
                        <div class="whead"><h6>Acciones</h6><div class="clear"></div></div>
                        <div class="body" align="center">
                            <?php //echo $this->Html->link("Volver &raquo;", array('controller'=>'Publicos', 'action'=>'generales'), array('class'=>'buttonS bLightBlue', 'escape' => FALSE)); ?>
                            <a href="javascript:history.go(-1)" class="buttonS bLightBlue">Atras</a>
                            <input type="button" class="buttonS bGreen" value="Imprimir" id="btnImprimir" />
                        </div>
    </div>
   </div>
<script type="text/javascript">
   $(document).ready(function() {

         $("#btnImprimir").click(function() {
            //console.log('click');
             printElem({ leaveOpen: true, printMode: 'popup' });
             //printElem({ overrideElementCSS: ['http://www.epcm.com/css/printable.css'] });
         });


     });
 function printElem(options){
     $('#areaImprimir').printElement(options);
 }

 </script>



